using System;
using System.Collections.Generic;
using System.Text;

namespace PSE.Deployment.SetupBase.Commands
{
    class HelpCommand : ICommand
    {
        #region ICommand Members

        public int Execute(string[] args)
        {
            if (args.Length > 1)
            {
                Messages.InvalidHelpCommand();
                return -1;
            }

            this.WriteHelpMessage();
            return 0;
        }

        #endregion

        private void WriteHelpMessage()
        {
            StringBuilder helpMessage = new StringBuilder();
            //helpMessage.Append(Messages.WriteHeader());

            helpMessage.AppendLine("USAGE:");
            helpMessage.AppendLine();
            helpMessage.AppendLine("   Setup.exe <command> [ <options> ]");
            helpMessage.AppendLine();
            helpMessage.AppendLine("COMMANDS:");
            helpMessage.AppendLine();
            helpMessage.AppendLine("   /install     - Install setup. (Short Form: /i) ");
            helpMessage.AppendLine("   /uninstall   - Uninstall setup. (Short Form: /u) ");
            helpMessage.AppendLine("   /change      - Change setup. (Short Form: /c) ");
            helpMessage.AppendLine("   /repair      - Repair setup. (Short Form: /r) ");
            helpMessage.AppendLine("   /help        - Displays command syntax and options for the tool. (Short Form: /?)");
            helpMessage.AppendLine();
            helpMessage.AppendLine();
            helpMessage.AppendLine("GENERAL OPTIONS:");
            helpMessage.AppendLine();
            helpMessage.AppendLine("   /hidewizard  - Show the setup wizard.");
            helpMessage.AppendLine("   /hideresult  - Show the setup result.");
            helpMessage.AppendLine("   /filename  - file name.");
            helpMessage.AppendLine();

            System.Console.Write(helpMessage.ToString());
        }
    }
}
